import axios from '../axios';
/**
 * 引用排序组件的各个模块请求服务器接口
 * @interface common/api/rankList
 * @author lxr
 */
export default {
  /**
   * @param  {Object} data - 外卖营业数据入参
   * @example 参数 {"timeFlag": "时间范围标识","beginTime": "开始时间时间戳（到秒）",
   * "endTime": "截止时间时间戳（到秒)", page: '1', limit: '10', sortFlagType: 0, sortFlag: 0,  foodCategoryCode: 0， storeCode: [10001]}
   * @returns {Object} 接口返回成功或者失败
   */
  getTakeAwayDish (data) {
    return axios.postWithSCode('/api/report/takeout/analysis/salesranking/list', data);
  },
  /**
   * @param  {Object} data - 获取员工营业贡献额排名(降序)
   * @example 参数 { "timeFlag": 1，"beginTime": 1501516800，"endTime": 1504195199}
   * @returns {Object} 接口返回成功或者失败
   */
  getEmpEarnRanking (data) {
    return axios.postWithSCode('/api/report/employee/performance/analysis/earnranking', data);
  },
  /**
   * @param  {Object} data - 获取员工服务台数排名(降序)
   * @example 参数 { "timeFlag": 1，"beginTime": 1501516800，"endTime": 1504195199}
   * @returns {Object} 接口返回成功或者失败
   */
  getEmpServiceRanking (data) {
    return axios.postWithSCode('/api/report/employee/performance/analysis/serviceranking', data);
  },
  /**
   * @param  {Object} data - 风险稽核退单详情入参
   * @example 参数 {timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573", mny: 100}
   * @returns {Object} 接口返回成功或者失败
   */
  getRiskBackData (data) {
    return axios.postWithSCode('api/report/risk/return', data);
  },
  /**
   * @param  {Object} data - 风险稽核返位单数入参
   * @example 参数 { storeCode: [1245,2345] , timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573", mny: 100}
   * @returns {Object} 接口返回成功或者失败
   */
  getRiskReturnCharge (data) {
    return axios.postWithSCode('api/report/risk/cancel', data);
  },
  /**
   * @param  {Object} data - 风险稽核赠单数详情入参
   * @example 参数 { storeCode: [1245,2345] , timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573", mny: 100}
   * @returns {Object} 接口返回成功或者失败
   */
  getRiskPresentCharge (data) {
    return axios.postWithSCode('api/report/risk/present', data);
  },
  /**
   * @param  {Object} data - 风险稽核宴请数详情入参
   * @example 参数 { storeCode: [1245,2345] , timeFlag: 1-日/2-周/3-月/4-年, beginTime: "1505727279573", endTime: "1505727279573", mny: 100}
   * @returns {Object} 接口返回成功或者失败
   */
  getRiskBanquetsCharge (data) {
    return axios.postWithSCode('api/report/risk/zero', data);
  },
  /**
   * @param  {Object} data - 获取畅销菜品排行入参
   * @example 参数 {"timeFlag": 1，"beginTime": 1501516800，"endTime": 1504195199}
   * @returns {Object} 接口返回成功或者失败
   */
  getPopularRank (data) {
    return axios.postWithSCode('/api/report/food/analysis/popular/item/ranking', data);
  },
  /**
   * @param  {Object} data - 获取滞销菜品排行入参
   * @example 参数 { "timeFlag": 1，"beginTime": 1501516800，"endTime": 1504195199}
   * @returns {Object} 接口返回成功或者失败
   */
  getUnsalableRank (data) {
    return axios.postWithSCode('/api/report/food/analysis/unsalable/item/ranking', data);
  },
  /**
   * @param  {Object} data - 获取菜类销售排行入参
   * @example 参数 {"timeFlag": 1，"beginTime": 1501516800，"endTime": 1504195199}
   * @returns {Object} 接口返回成功或者失败
   */
  getPopularItemRank (data) {
    return axios.postWithSCode('/api/report/food/analysis/itemclass/ranking', data);
  }
};
